home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / dwdll.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.5 KB  |  117 lines

  1. /* Copyright (C) 1996, Russell Lang.  All rights reserved.
  2.   Portions Copyright (C) 1999 Aladdin Enterprises.  All rights reserved.
  3.   
  4.   This file is part of AFPL Ghostscript.
  5.   
  6.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  7.   distributor accepts any responsibility for the consequences of using it, or
  8.   for whether it serves any particular purpose or works at all, unless he or
  9.   she says so in writing.  Refer to the Aladdin Free Public License (the
  10.   "License") for full details.
  11.   
  12.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  13.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  14.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  15.   conditions described in the License.  Among other things, the License
  16.   requires that the copyright notice and this notice be preserved on all
  17.   copies.
  18. */
  19.  
  20.  
  21. // $Id: dwdll.h,v 1.2 2000/09/19 19:00:09 lpd Exp $
  22.  
  23. // gsdll_class for MS-Windows
  24.  
  25. #ifndef dwdll_INCLUDED
  26. #  define dwdll_INCLUDED
  27.  
  28. extern "C" {
  29. #include "gsdll.h"
  30. #include "gsdllwin.h"
  31. }
  32.  
  33. class gsdll_class {
  34.     // instance of caller
  35.     HINSTANCE hinstance;
  36.     // handle to DLL.  Non-zero of loaded.
  37.     HINSTANCE hmodule;
  38.     // handle to parent window.  Can be NULL.
  39.     HWND hwnd;
  40.     // text description of last error
  41.     char last_error[128];
  42.     // true if init and execute_begin have been called
  43.     BOOL initialized;
  44.     // return code from last c_execute_end
  45.     int execute_code;
  46.  
  47.     // pointer to callback from DLL
  48.     GSDLL_CALLBACK callback;
  49.  
  50.     // pointers to DLL functions
  51.     PFN_gsdll_revision c_revision;
  52.     PFN_gsdll_init c_init;
  53.     PFN_gsdll_execute_begin c_execute_begin;
  54.     PFN_gsdll_execute_cont c_execute_cont;
  55.     PFN_gsdll_execute_end c_execute_end;
  56.     PFN_gsdll_exit c_exit;
  57.     PFN_gsdll_lock_device c_lock_device;
  58.     PFN_gsdll_copy_dib c_copy_dib;
  59.     PFN_gsdll_copy_palette c_copy_palette;
  60.     PFN_gsdll_draw c_draw;
  61.  
  62.     // pointer to os2dll or mswindll device
  63.     // this needs to be extended to support multiple devices
  64.     // also need to have one window per device
  65.     char FAR *device;
  66.  
  67.  
  68.         public:
  69.     // Load DLL
  70.     // Arguments:
  71.     //   instance of calling EXE
  72.     //   name of DLL, may include path
  73.     //   expected version number of DLL
  74.     // Returns:
  75.     //   zero on success
  76.     //   non-zero on error.  Error message available from get_last_error()
  77.     // do nothing if DLL already loaded
  78.     int load(const HINSTANCE hinstance, const char *name, const long version);
  79.  
  80.     // Get revision number of DLL
  81.     int revision(char FAR * FAR *, char FAR * FAR *, long FAR *, long FAR *);
  82.  
  83.     // Unload DLL
  84.     int unload(void);
  85.  
  86.     // Initialise DLL
  87.     // Arguments:
  88.     //   pointer to C callback function
  89.     //   window handle of parent
  90.     //   argc  (normal C command line)
  91.     //   argv  (normal C command line)
  92.     int init(GSDLL_CALLBACK callback, HWND hwnd, int argc, char FAR * FAR * argv);
  93.  
  94.     // Restart DLL
  95.     int restart(int argc, char FAR * FAR * argv);
  96.  
  97.     // Execute string
  98.     int execute(const char FAR *, int len);
  99.  
  100.     // Get last error string
  101.     int get_last_error(char *str, int len);
  102.  
  103.     // lock device
  104.     int gsdll_class::lock_device(const char FAR * device, int lock);
  105.  
  106.     // draw bitmap
  107.     int gsdll_class::draw(const char FAR * device, HDC hdc, int dx, int dy, int wx, int wy, int sx, int sy);
  108.  
  109.     // copy bitmap
  110.     HGLOBAL gsdll_class::copy_dib(const char FAR * device);
  111.  
  112.     // copy palette
  113.     HPALETTE gsdll_class::copy_palette(const char FAR * device);
  114. };
  115.  
  116. #endif /* dwdll_INCLUDED */
  117.